package com.example.loan;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("houses")
public class HouseController {
    /**
     * 接口1：house 数量
     * 接口2： 信用报告，Credit Report

     */
    @GetMapping("{idCard}/count")
    public HouseCount count(@PathVariable String idCard) {
        int number;
        switch (idCard) {
            case "410000000000000000":
                number = 0;
                break;
            case "410000000000000001":
                number = 1;
                break;
            case "410000000000000002":
                number = 2;
                break;
            case "410000000000000003":
                number = 3;
                break;
            default:
                number = 4;
                break;
        }
        return new HouseCount(number);
    }

}
